package com.example.secondhandsysapi.Service;

import com.example.secondhandsysapi.Entity.GoodsInfo;
import com.example.secondhandsysapi.Vo.CategoryGoodsInfo;
import com.example.secondhandsysapi.Vo.GoodsPostInfo;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.sql.Date;
import java.util.List;

public interface GoodsInfoService {
    //前端查询
    List<GoodsInfo> getAllGoodsInfo(String name);
    Integer deleteById(Integer goodsid);
    List<GoodsInfo> getAllGoodsInfoByPrice(Integer price);
    List<GoodsInfo> getAllGoodsInfoByPriceAndName(String goodsName,Integer goodsPrice);

    //后端商品管理，显示所有商品
    List<GoodsInfo> getAllBackendGoodsInfo();

    //获取商品详情页的信息
    List<GoodsInfo> getAllGoodsDetailsInfoByGoodsId(Integer goods_id);
//获取详情页商品推荐
    List<GoodsInfo> getAllGoodsInfoByCategoryId(Integer category_id);
    //获取待审核的商品信息
    List<GoodsInfo> getAllUpdateGoodsInfo(@Param("user_id") Integer user_id, @Param("goods_name") String goods_name);
    List<GoodsInfo> getAllGoodsInfo1();
    List<GoodsInfo> getAllGoodsInfoByName(@Param("goods_name") String goods_name);
    List<GoodsInfo> getAllGoodsInfoByID(@Param("user_id") Integer user_id);
    //获取商品的分页信息
    PageInfo<GoodsInfo> getGoodsInfo(int pageNum, int pageSize);

    //修改商品的通过审核状态
    Integer updateStatus(@Param("goods_id") Integer goods_id);

    //拒绝后商品的备注信息
    Integer updateCheck_Info(@Param("check_info") String check_info,@Param("goods_id") Integer goods_id );

    //插入商品发布的信息到数据库
    Integer insertGoodsInfo(GoodsPostInfo goodsPostInfo);

    //得到随机的商品信息
    List<GoodsInfo> getRandomGoodsInfo();

    //得到对应用户已发布的商品
    List<GoodsPostInfo> getPublicProduct(@Param("user_id") Integer user_id);

    //我发布的商品，点击修改回显商品信息
    List<GoodsInfo> getProductDetailById(@Param("id") Integer id);

    List<GoodsInfo> getAllGoodsInfoPostCategory(Date goods_post, Integer category_id);
    List<GoodsInfo> getAllGoodsInfoPost(Date goods_Post);
    List<GoodsInfo> getAllGoodsInfoCategory(Integer category_id);
    List<GoodsInfo> getAllGoodsInfo3();

    List<CategoryGoodsInfo> getAllCategoryGoodsId(@Param("category_id") Integer category_id);

//前端根据商品名称查询
    List<GoodsInfo> getAllGoodsInfoName(String goods_name);

    List<GoodsInfo> getAllGoodsInfoByNa(String name);

    //修改已发布的商品信息
    Integer updateProductInfo(GoodsInfo goodsInfo);

}